1. Field of the Invention
The present invention relates to a method for deciding an image data reduction ratio in image processing of an image to be searched, a pattern model positioning method in image processing, a pattern model creating method in image processing, an image processing apparatus, an image processing program, and a computer readable recording medium, upon positioning by searching an object to be searched that is similar to a pre-registered image out of the image to be searched by use of a pattern model corresponding to the registered image.
2. Description of the Related Art
An image processing apparatus for processing an image picked up by an image pickup element typically includes: an image pickup apparatus for picking up an image processing object (hereinafter also referred to as “work”); an image data storing device for storing data on the image picked up by the image pickup apparatus; and an image data processing device for processing the image data stored by the image data storing device. For example, in the image processing apparatus in which the image pickup apparatus is made up of a CCD camera, luminance data (so-called multi-valued data) such as 256 levels of gray or 1024 levels of gray is obtained based on each of charge amounts of a large number of charge coupled elements constituting an image pickup surface, whereby a position, a rotational angle and the like of the work as an object to be searched can be found. Conventionally, as techniques for performing processing on image data to search an object to be searched in image processing, there are known a difference search performed using a total value of absolute values of pixel difference values between images, a normalized correlation search performed using normalized correlation values between images, and the like. In these searches, an object to be searched that is wished to be searched is previously registered as a template image, and based on the image, a search is executed for the object to be searched out of an image to be searched. In these search processing, a region-based search by use of image data has conventionally been mainstream. However, such a conventional region-based search based on image thickness or the like has the problem of being susceptible to a change in illumination upon image pickup, and the like.
Meanwhile, there has also been provided a method for performing edge extraction processing on a registered image and an image to be searched, to perform a search based on edge information. In this method, a concentration value of pixels constituting image data is not used, but edge data based on an amount of change in concentration value is used, and hence it is possible to obtain the advantage of being not susceptible to fluctuations in illumination upon image pickup. Especially, in recent years, an edge-based pattern search with an edge regarded as a characteristic amount is drawing attention for its high robustness, and is in practical use in industrial applications and the like.
As a technique for improving a processing speed of a pattern search, a “coarse to fine” approach is known. Namely, first, a search is coarsely performed using a low-resolution image (coarse image), and after a rough position is specified, detailed positioning is performed using a high-resolution image (fine image), thereby to enhance accuracy of a position and posture. In the case of performing the edge-based search by means of coarse-to-fine type template matching, a pyramid search is used where a search is performed using coarse data obtained by compressing (also referred to as “thinning out” or the like) original data, to specify a rough position, and thereafter, a search is performed using detailed data. FIG. 87 shows a concept of the pyramid search. As shown in this drawing, a rough search (referred to as “coarse search” or the like) is performed using a low-resolution image having a high reduction ratio, to find a rough position. Thereafter, a search is performed in the vicinity thereof with an increased resolution and an intermediate reduction ratio, and finally, a fine search is performed on an image of an original size or an image having a reduction ratio close to the original size. As thus described, in the typical pyramid search, a plurality of images having changed resolutions are prepared, and a schematic position is first detected by use of an image having the lowest resolution. In subsequent processing, a search range is narrowed down to the vicinity of the previous detected position as the resolution is gradually increased. Thereby, the accuracy of the detected position enhances with each succeeding processing level, finally leading to detection of a highly accurate position with the resolution being that of the original image or closer thereto. As a technique concerning fine positioning for finding a position and posture with high accuracy by means of such coarse-to-fine type template matching, an image processing apparatus of Japanese Patent No. 3759983 is known.
In typical fine positioning, detailed positioning is performed by extracting an edge with respect to the original size of the image to be searched and finding an error value by a least squares method, or by some other means. However, as a result of their earnest studies, the present inventor found that the accuracy of the fine positioning by use of the edge deteriorates when the image to be searched is unclear due to blurring or the like. This is thought to be because, since an edge position is difficult to constantly set in an unclear image and is thus easily displaced, a detection result of the edge is not stable, to cause deterioration in accuracy.
For example, an image in which pixels change sharply as shown in FIG. 53 is considered. A contour, namely an edge, of this image is a so-called step edge where a pixel concentration, namely a pixel value, changes stepwise as shown in FIG. 54. Therefore, as shown in FIG. 55, as for a change in edge strength, a border tends to appear sharply, and accurate positioning can be expected.
However, when an original binary image is an unclear and blurred image since being out of focus or fogged, the border portion changes gently as shown in FIG. 56, resulting in that the change in edge strength becomes a poorly sloping waved curve as shown in FIG. 57, and even a slight change in edge strength leads to a large fluctuation in coordinate position, thereby to destabilize the edge. There has thus been a problem in that also in the positioning, even a slight fluctuation in peripheral environment such as a change in illumination or light amount exerts an effect on the edge detection accuracy, thereby to prevent stable edge detection and lower the reliability of image processing such as image recognition.